Skip to content

IM3: 경쟁업체 InfoWindow 카카오맵 link + 전화번호 노출#187

Merged
bat1120 merged 2 commits into
devfrom
IM3-competitor-place-url
May 4, 2026
Merged

IM3: 경쟁업체 InfoWindow 카카오맵 link + 전화번호 노출#187
bat1120 merged 2 commits into
devfrom
IM3-competitor-place-url

Conversation

@bat1120

@bat1120 bat1120 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

상권분석 페이지 경쟁업체 마커 클릭 시 InfoWindow 의 매장명을 카카오맵 place 페이지 로 연결. 전화번호도 함께 노출 (tel: 링크).

`kakao_store.place_url` / `kakao_store.phone` 컬럼이 이미 존재하지만 기존 SELECT 누락 → 응답 노출 안 되던 이슈.

변경

파일 영역 변경
`commercial_intelligence.py` A1 analyze_competition SQL SELECT 에 place_url, phone 추가
`main.py` 공통 _collect_all_competitor_locations 결과 dict 에 두 필드 추가
`types/index.ts` C1 all_competitor_locations 항목에 옵셔널 필드 3개 (place_url, phone, category)
`MarketMap.tsx` C1 Competitor interface + InfoWindow 매장명 a 태그 + tel: 링크. escapeHtml 추가
`MapSection.tsx` C1 buildCompetitors 두 분기 모두 place_url/phone 패스스루

UX

경쟁업체 마커 클릭
    ↓
InfoWindow 표시:
  ● [본죽] ← 클릭 시 http://place.map.kakao.com/287510690 새 창
    매장: 본죽&비빔밥cafe 홍대점
    거리: 320m / 반경: 내부
    일매출 추정: ...
    전화: 02-323-6288 ← tel: 링크

Schema 변경 (Backend)

`schemas/simulation_output.py` 의 `all_competitor_locations: list[dict]` 이라 명시적 schema 변경 불필요. extra='allow' 패턴.

Test plan

  • backend ruff format 통과
  • frontend prettier 통과
  • backend 재시작 후 실제 시뮬 1회 → kakao_store DB 의 place_url/phone 값이 응답에 포함되는지 확인
  • frontend 경쟁업체 InfoWindow 클릭 시 카카오맵 새 창 열리는지 수동 테스트
  • 전화번호 클릭 시 tel: 링크 작동 (모바일 한정)

영역

  • A1 (`services/commercial_intelligence.py`) — 본인
  • 공통 (`main.py`) — 1줄 추가만
  • C1 (`frontend/*`) — 강민 영역. 본 PR 에서 함께 처리 (사용자 요청).

🤖 Generated with Claude Code

bat1120 and others added 2 commits May 4, 2026 23:16
상권분석 페이지 경쟁업체 마커 클릭 시 InfoWindow 에서 매장명을
카카오맵 place 페이지(http://place.map.kakao.com/{kakao_id}) 로
연결. 전화번호도 함께 노출 (tel: 링크).

변경:
- backend/src/services/commercial_intelligence.py
    analyze_competition SQL 의 SELECT 에 place_url, phone 컬럼 추가.
    samples dict 에 두 필드 자동 포함 (기존 row_dict 패턴).

- backend/src/main.py
    _collect_all_competitor_locations 결과 dict 에 place_url, phone 추가.
    schemas/simulation_output.py 의 all_competitor_locations 는 list[dict]
    이라 별도 schema 변경 불필요 (extra='allow').

- frontend/src/types/index.ts
    SimulationOutput.all_competitor_locations 항목에 place_url, phone,
    category 옵셔널 필드 추가.

- frontend/.../MarketMap.tsx
    Competitor interface 확장 (place_url, phone).
    buildCompetitorInfoHtml: place_url 있으면 매장명을 a 태그로 감싸
    target=_blank 새 창. phone 있으면 tel: 링크. escapeHtml 추가.

- frontend/.../MapSection.tsx
    buildCompetitors 의 두 분기 (all_competitor_locations / competition_500m)
    모두에서 place_url, phone 패스스루.

검증:
- ruff format 통과 (commercial_intelligence.py)
- prettier 통과 (3 frontend 파일)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
이전 commit (ac48834) 이 경쟁업체 (all_competitor_locations) 만
처리했고, 자사 매장 (same_brand_locations) 측 누락. 두 흐름이
별개 SQL/dict 변환 경로라 자사 측도 같은 패턴으로 보강.

변경:
- backend/src/services/brand_mapping_resolver.py
    get_all_mapo_stores_by_brand SQL SELECT 에 place_url, phone 추가.

- backend/src/main.py
    _collect_same_brand_locations 결과 dict 에 place_url, phone 추가.

- frontend/src/types/index.ts
    SimulationOutput.same_brand_locations 항목에 place_url, phone 옵셔널 추가.

- frontend/.../MarketMap.tsx
    SameBrandLocation interface 확장.
    자사 매장 InfoWindow: place_url 있으면 brand_name + place_name 둘 다
    카카오맵 새 창 link 로 표시. phone 있으면 tel: 링크.
    경쟁업체 InfoWindow 와 동일 패턴.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bat1120 bat1120 merged commit 97bdd5d into dev May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant